import request from '@/config/axios'

export interface MaterialImageVO {
  id: number
  materialUrl: string
  width: number
  height: number
  userId: number
}

// 查询图片分页
export const getMaterialImagePage = async (params) => {
  return await request.get({ url: `/operate/material-image/page`, params })
}

// 查询图片详情
export const getMaterialImage = async (id: number) => {
  return await request.get({ url: `/operate/material-image/get?id=` + id })
}

// 新增图片
export const createMaterialImage = async (data: MaterialImageVO) => {
  return await request.post({ url: `/operate/material-image/create`, data })
}

// 修改图片
export const updateMaterialImage = async (data: MaterialImageVO) => {
  return await request.put({ url: `/operate/material-image/update`, data })
}

// 删除图片
export const deleteMaterialImage = async (id: number) => {
  return await request.delete({ url: `/operate/material-image/delete?id=` + id })
}

// 导出图片 Excel
export const exportMaterialImage = async (params) => {
  return await request.download({ url: `/operate/material-image/export-excel`, params })
}